Final Fantasy V Save Format Details By: MottZilla This document is notes on the save data in Final Fantasy V. With this information you can modify data however you wish. --- FFV has 8 Kilobytes of SRAM divided up into 5 parts. The first four parts are the 4 save slots. They are arranged on $700 byte increments but only $600 bytes are used in each file. At $1C00 most of the area is empty except for the end around $1FF0 which holds data about each save file. All four save files are the same data just at different locations. The final area will be explained first. $0000 - Save Slot 1 $0700 - Save Slot 2 $0E00 - Save Slot 3 $1500 - Save Slot 4 $1FF0 - Checksum and Use Table --- At $1FF0, which would appear at $7FF0 relative to the SNES memory map, there is a table of four 16-bit checksums. Then at $1FF8 there is another table which contains $E41B if a save file is in use, anything else and it is not. The checksums are generated by taking the $600 byte file and adding each 16-bit word together. Carry is used so if the value overflows from $FFFF you will set carry and impact the next addition with ADC. Example: $FFFF + $0001 = $0000 + Carry Final Result: $0001 Whenever a file appears for loading or saving the checksum is quickly calculated to determine if the file is valid. If the checksum fails or the $1FF8 table entry doesn't contain $E41B then it appears blank, however it may still contain data as it is not overwritten. You can use this code patch to disable failure of checksums allowing for any data to be consider valid. $C2/F576 : EA $C2/F577 : EA Here is a disassembly related to saving. Disassembly: $C2/F561 A5 F6 LDA $F6 [$00:01F6] $C2/F563 29 03 00 AND #$0003 $C2/F566 0A ASL A $C2/F567 AA TAX $C2/F568 BD F8 7F LDA $7FF8,x[$30:7FF8] ; Check Slot In-Use Table $C2/F56B C9 1B E4 CMP #$E41B $C2/F56E D0 0D BNE $0D [$F57D] ; If not $E41B Skip $C2/F570 20 88 F5 JSR $F588 [$C2:F588] ; $F588 Returns Checksum $C2/F573 DD F0 7F CMP $7FF0,x[$30:7FF0] ; Compare against Csum $C2/F576 D0 0A BNE $0A [$F582] ; table. $C2/F578 A9 00 00 LDA #$0000 ; $0000 File Valid $C2/F57B 80 08 BRA $08 [$F585] $C2/F57D A9 00 80 LDA #$8000 ; File not in Use $C2/F580 80 03 BRA $03 [$F585] $C2/F582 A9 00 40 LDA #$4000 ; Bad Checksum $C2/F585 85 E0 STA $E0 [$00:01E0] $C2/F587 60 RTS $C2/F588 8B PHB $C2/F589 DA PHX $C2/F58A 5A PHY $C2/F58B 08 PHP $C2/F58C F4 30 30 PEA $3030 $C2/F58F AB PLB $C2/F590 AB PLB $C2/F591 C2 20 REP #$20 $C2/F593 A6 FC LDX $FC [$00:01FC] $C2/F595 A0 00 06 LDY #$0600 ; Save File Size $C2/F598 A5 8E LDA $8E [$00:018E] $C2/F59A 18 CLC $C2/F59B 7D 00 00 ADC $0000,x[$30:0000] $C2/F59E E8 INX $C2/F59F E8 INX $C2/F5A0 88 DEY $C2/F5A1 88 DEY $C2/F5A2 D0 F7 BNE $F7 [$F59B] $C2/F5A4 28 PLP $C2/F5A5 7A PLY $C2/F5A6 FA PLX $C2/F5A7 AB PLB $C2/F5A8 60 RTS --- Interesting Save Slot File addresses. There are 4 character slots at the beginning of save files. Each character slot is $50 bytes. $0000 - Character Slot 1 $0050 - Character Slot 2 $00A0 - Character Slot 3 $00F0 - Character Slot 4 Within each character slot. $00 Bit7 toggle if Character is in Front Row or Back Row. Bit6 toggle if Character is present in party or empty. Bits 012 determine Character, Bartz, Lenna, Galuf, Faris, Krile. $01 - Current Job. Table: $00 Knight $01 Monk $02 Thief $03 Dragoon $04 Ninja $05 Samurai $06 Berserkr $07 Hunter $08 MysticKnt $09 WhiteMage $0A BlackMage $0B TimeMage $0C Summoner $0D BlueMage $0E Red Mage $0F Mediator $10 Chemist $11 Geomancr $12 Bard $13 Dancer $14 Mimic $15 Normal $02 - Current Level $03 - Experience Points (24-bit) $06 - Current HP (16-bit) $08 - Maximum HP (16-bit) $0A - Current MP (16-bit) $0C - Maximum MP (16-bit) $0E - Equipped Head Item $0F - Equipped Body Item $10 - Equipped Relic Item $13 - Equipped R-Hand Item $14 - Equipped L-Hand Item $16 - Battle Command Slot 1 $17 - Battle Command Slot 2 $18 - Battle Command Slot 3 $19 - Battle Command Slot 4 $1A - Status (ex: Poison) $24 - Strength $25 - Agility $26 - Vitality $27 - Magic Power $3A - Job Level $3B - Ability Points --- Inventory for each slot is at $140. The first $100 bytes make up a table of Item types. For example $E0 is a Potion. At $240 is another $100 byte table for how many of each item you have. At $03F7 there appears to be bit tables which store what abilities each character has learned. No exact details available yet. May be $14 byte tables for each character. ( These Masks apply to all characters ) $0450 - Sword Ability Bitmask, then White Magic Ability Bit Mask then Black Magic, then DmMagic, then Esper, then Song, Ending at $045B as last byte of Songs. $0447 - Money/Gold/Gil (24-bit) $05D8 - Map X Position $05D9 - Map Y Position EOF